package base

import (
	log "github.com/sirupsen/logrus"
)

//全局暴露，单例
var apiInitializerRegister *InitializerRegister = &InitializerRegister{}

func RegisterApi(ai Initializer) {
	apiInitializerRegister.Register(ai)
}

func GetApis() []Initializer {
	return apiInitializerRegister.Initializers
}

type WebApiStarter struct {
	BaseStarter
}

func (s *WebApiStarter) Init(ctx StarterContext) {

}
func (s *WebApiStarter) Setup(ctx StarterContext) {
	log.Info("InitializerRegister：len=", len(GetApis()))
	for _, v := range GetApis() {
		v.Init()
	}
}
